#include "BaseTableTest.h"
#include "ui_BaseTableTest.h"
BaseTableTest::BaseTableTest(QWidget *parent) :
    QWidget(parent),ui(new Ui::BaseTableTest)
{
    ui->setupUi(this);
    //设置测试列
    int colunmCount=10;
    for(int i=0;i<colunmCount;i++)
    {
        ui->tableView_TestTable->addColumn("列"+QString::number(i+1));
    }
    //添加测试行
    int rowCount=17;
    for(int i=0;i<rowCount;i++)
    {
        QVector<QVariant> rowData;
        for(int j=0;j<colunmCount;j++)
        {
            rowData<<QString("行%1列%2").arg(i+1).arg(j+1);
        }
        testDataMap.insert(i+1,rowData);
        ui->tableView_TestTable->addRowData(i+1,rowData);
    }
    connect(ui->tableView_TestTable,&GY_IdTableView::selectCellChangeSignal,[&](const QVariant &rowId,const int columnIndex)
    {
        QVariant data=ui->tableView_TestTable->getCellData(rowId,columnIndex);
        ui->lineEdit_EditValue->setText(data.toString());
    });
}

BaseTableTest::~BaseTableTest()
{
    delete ui;
}
